package cn.initcap.elasticjob.job;

import cn.initcap.elasticjob.autoconfig.ElasticSimpleJob;
import cn.initcap.elasticjob.service.OrderService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author initcap
 * @date 6/26/19 3:34 PM
 */
@ElasticSimpleJob(
        jobName = "thirdOrderProduceJob",
        cron = "0/5 * * * * ?",
        shardingTotalCount = 2,
        overwrite = true
)
public class ThirdOrderProduceJob implements SimpleJob {
    @Autowired
    private OrderService orderService;

    @Override
    public void execute(ShardingContext shardingContext) {
        orderService.produceThirdOrder();
    }
}
